<script src="__STATIC__/plugins/laydate/laydate.js"></script>
<div class="row">
    <div class="col-md-12">
        <div class="box">
            <div class="box-body">
                <form class="form-inline" name="searchForm" id="searchForm" action="" method="GET">
                    <div class="form-group">
                        <input id="start_date" style="background: #fff" readonly name="start_date" value="{$start_date ? $start_date : '' ;}"
                               class=" form-control input-sm" placeholder="起始日期">
                    </div>
                    <div class="form-group">
                        <input id="end_date" style="background: #fff" readonly name="end_date" value="{$end_date ? $end_date : '' ;}"
                               class=" form-control input-sm " placeholder="截止日期">
                    </div>
                    <div class="form-group">
                        <select name="user_id" class="form-control input-sm">
                            <option value="-1">选择用户</option>
                            {foreach name="user_list" item="user"}
                            <option value="{$user.id}" {if isset($user_id)&&
                                    $user_id==$user.id}selected{/if}>{$user.nickname}({$user.name})
                            </option>
                            {/foreach}
                        </select>
                    </div>
                    <div class="form-group">
                        <input value="{$title ? $title : '' ;}"
                               name="title" id="title" class="form-control input-sm" placeholder="操作名称">
                    </div>
                    <div class="form-group">
                        <button class="btn btn-primary btn-sm" type="submit"><i class="fa fa-search"></i> 查询
                        </button>
                    </div>
                    <div class="form-group">
                        <button onclick="clear_form()" class="btn btn-default btn-sm" type="button"><i
                                class="fa  fa-eraser"></i> 清空查询
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-md-12">
        <div class="box">
            <div class="box-body table-responsive no-padding">
                <table class="table table-hover table-bordered">
                    <tbody>
                    <tr>
                        <th>ID</th>
                        <th>用户名</th>
                        <th>操作</th>
                        <th>URL</th>
                        <th>请求方式</th>
                        <th>IP</th>
                        <th>日期</th>
                        <th>操作</th>
                    </tr>
                    {foreach name='list' item='list'}
                    <tr>
                        <td>{$list.id}</td>
                        <td>{$list->adminuser['name']}</td>
                        <td>{$list.title}</td>
                        <td>{$list.log_url}</td>
                        <td>{$list.log_type}</td>
                        <td>{$list.log_ip}</td>
                        <td>{$list.create_time}</td>
                        <td class="td-do">
                            <a data-id="{$list.id}" data-url="view" data-confirm="2" data-type="2"
                               class="btn btn-default btn-xs AjaxButton" title="查看详情">
                                <i class="fa fa-eye"></i>
                            </a>
                        </td>
                    </tr>
                    {/foreach}
                    </tbody>
                </table>
            </div>
            {include file="template/data_footer" /}
        </div>
    </div>
</div>
<script>
    var start = {
        elem: '#start_date',
        max: laydate.now(),
        istoday: false,
        choose: function (datas) {
            end.min = datas; //开始日选好后，重置结束日的最小日期
            end.start = datas; //将结束日的初始值设定为开始日
        }
    };
    var end = {
        elem: '#end_date',
        max: laydate.now(),
        choose: function (datas) {
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
    laydate(start);
    laydate(end);
</script>